This patent is a modification of the photoionizer described in U.S. Pat. No. 4,377,749 filed Feb. 25, 1981 in the name of the present inventor. The modification relates to the electrode structure which now includes a non-reactive, stable, photocathode from which electrons are ejected by photons, and these electrons are further utilized. At high sample gas pressure, the electrons form negative ions by attachment to constituents of the sample and these are later measured. This constitutes an electron capture detector in chromatography. At low sample pressure, the electrons form the photocathode are accelerated to ionization energies (.apprxeq.100 ev) and used to ionize a low pressure sample gas, and these ions are analyzed in a mass spectrometer.